﻿// TestCaseModel
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.Text;

namespace TestCaseModel
{
    /// <summary>
    /// This is the factory to retrieve a test case generator
    /// according to the global settings.
    /// </summary>
    class GeneratorFactory
    {
        public static ITcGenerator GetGenerator()
        {
            return GetGenerator(GlobalSettings.GeneratorToUse);
        }

        public static ITcGenerator GetGenerator(GlobalSettings.TcGenerator generatorType)
        {
            switch (generatorType)
            {
                case GlobalSettings.TcGenerator.MSPICT:
                    return new PictGenerator();
                case GlobalSettings.TcGenerator.SIMPLE:
                    return new SimpleGenerator();
                default:
                    throw new Exception("Unknow generator type");
            }
        }
    }
}
